Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheoDoiCongNo_KhachHang_DakNong
    Private thang, nam As String
    Private customerReport As ReportDocument

    Delegate Sub WaitDelegate()

    Private Sub FrmCrTheoDoiCongNo_KhachHang_DakNong_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        globalVariale.runWaitting = True
        Dim wd As New WaitDelegate(AddressOf moduleWaitting.runningWait)
        wd.BeginInvoke(Nothing, Nothing)

        Dim sqlQuery As String = "SELECT * FROM tbl_temp_theodoi_congno_khachhang"
        Dim reportPath = Application.StartupPath & "\" & "CrTheoDoiCongNoKhachHang_Daknong.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("TThang", thang)
        customerReport.SetParameterValue("TNam", nam)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        Me.CrNXTTongHopview.ReportSource = customerReport

        globalVariale.runWaitting = False
        
    End Sub

    Public Sub setThang(ByVal s As String)
        thang = s
    End Sub

    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub

End Class
